home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / xemacs.info-13 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  48.2 KB  |  1,140 lines

  1. This is Info file ../../info/xemacs.info, produced by Makeinfo-1.63
  2. from the input file xemacs.texi.
  3.  
  4.    This file documents the XEmacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
  7. 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
  8. Microsystems, Inc.  Copyright (C) 1995 Amdahl Corporation.
  9.  
  10.    Permission is granted to make and distribute verbatim copies of this
  11. manual provided the copyright notice and this permission notice are
  12. preserved on all copies.
  13.  
  14.    Permission is granted to copy and distribute modified versions of
  15. this manual under the conditions for verbatim copying, provided also
  16. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  17. General Public License" are included exactly as in the original, and
  18. provided that the entire resulting derived work is distributed under the
  19. terms of a permission notice identical to this one.
  20.  
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for modified
  23. versions, except that the sections entitled "The GNU Manifesto",
  24. "Distribution" and "GNU General Public License" may be included in a
  25. translation approved by the author instead of in the original English.
  26.  
  27. 
  28. File: xemacs.info,  Node: Special Diary Entries,  Prev: Format of Diary File,  Up: Diary
  29.  
  30. Special Diary Entries
  31. ---------------------
  32.  
  33.    In addition to entries based on calendar dates, your diary file can
  34. contain entries for regularly occurring events such as anniversaries.
  35. These entries are based on expressions (sexps) that Emacs evaluates as
  36. it scans the diary file.  Such an entry is indicated by `%%' at the
  37. beginning (preceded by `&' for a nonmarking entry), followed by a sexp
  38. in parentheses.  Calendar mode offers commands to make it easier to put
  39. some of these special entries in your diary.
  40.  
  41. `i a'
  42.      Add an anniversary diary entry for the selected date
  43.      (`insert-anniversary-diary-entry').
  44.  
  45. `i b'
  46.      Add a block diary entry for the current region
  47.      (`insert-block-diary-entry').
  48.  
  49. `i c'
  50.      Add a cyclic diary entry starting at the date
  51.      (`insert-cyclic-diary-entry').
  52.  
  53.    If you want to make a diary entry that applies to the anniversary of
  54. a specific date, move point to that date and use the `i a' command.
  55. This displays the end of your diary file in another window and inserts
  56. the anniversary description; you can then type the rest of the diary
  57. entry.
  58.  
  59.    The effect of `i a' is to add a `diary-anniversary' sexp to your
  60. diary file.  You can also add one manually, for instance:
  61.  
  62.      %%(diary-anniversary 10 31 1948) Arthur's birthday
  63.  
  64. This entry applies to October 31 in any year after 1948; `10 31 1948'
  65. specifies the date.  (If you are using the European calendar style, the
  66. month and day are interchanged.)  The reason this sexp requires a
  67. beginning year is that advanced diary functions can use it to calculate
  68. the number of elapsed years (*note Sexp Diary Entries::.).
  69.  
  70.    You can make a diary entry entry for a block of dates by setting the
  71. mark at the date at one end of the block, moving point to the date at
  72. the other end of the block, and using the `i b' command.  This command
  73. causes the end of your diary file to be displayed in another window and
  74. the block description to be inserted; you can then type the diary entry.
  75.  
  76.    Here is such a diary entry that applies to all dates from June 24,
  77. 1990 through July 10, 1990:
  78.  
  79.      %%(diary-block 6 24 1990 7 10 1990) Vacation
  80.  
  81. The `6 24 1990' indicates the starting date and the `7 10 1990'
  82. indicates the stopping date.  (Again, if you are using the European
  83. calendar style, the month and day are interchanged.)
  84.  
  85.    You can specify cyclic diary entries that repeat after a fixed
  86. interval of days.  Move point to the starting date and use the `i c'
  87. command.  After you specify the length of interval, this command
  88. displays the end of your diary file in another window and inserts the
  89. cyclic event description; you can then type the rest of the diary entry.
  90.  
  91.    The sexp corresponding to the `i c' command looks like:
  92.  
  93.      %%(diary-cyclic 50 3 1 1990) Renew medication
  94.  
  95. which applies to March 1, 1990 and every 50th day following; `3 1 1990'
  96. specifies the starting date.  (If you are using the European calendar
  97. style, the month and day are interchanged.)
  98.  
  99.    All three of the these commands make marking diary entries.  If you
  100. want the diary entry to be nonmarking, give a numeric argument to the
  101. command.  For example, `C-u i a' makes a nonmarking anniversary diary
  102. entry.
  103.  
  104.    Marking sexp diary entries in the calendar is *extremely*
  105. time-consuming, since every date visible in the calendar window must be
  106. individually checked.  So it's a good idea to make sexp diary entries
  107. nonmarking with `&'.
  108.  
  109.    One sophisticated kind of sexp, a floating diary entry, has no
  110. corresponding command.  The floating diary entry specifies a
  111. regularly-occurring event by offsets specified in days, weeks, and
  112. months.  It is comparable to a crontab entry interpreted by the `cron'
  113. utility on Unix systems.
  114.  
  115.    Here is a nonmarking, floating diary entry that applies to the last
  116. Thursday in November:
  117.  
  118.      &%%(diary-float 11 4 -1) American Thanksgiving
  119.  
  120. The 11 specifies November (the eleventh month), the 4 specifies Thursday
  121. (the fourth day of the week, where Sunday is numbered zero), and the -1
  122. specifies "last" (1 would mean "first", 2 would mean "second", -2 would
  123. mean "second-to-last", and so on).  The month can be a single month or
  124. a list of months.  Thus you could change the 11 above to `'(1 2 3)' and
  125. have the entry apply to the last Thursday of January, February, and
  126. March.  If the month is `t', the entry applies to all months of the
  127. year.
  128.  
  129.    The sexp feature of the diary allows you to specify diary entries
  130. based on any Emacs Lisp expression.  You can use the library of built-in
  131. functions or you can write your own functions.  The built-in functions
  132. include the ones shown in this section, plus a few others (*note Sexp
  133. Diary Entries::.).
  134.  
  135.    The generality of sexps lets you specify any diary entry that you can
  136. describe algorithmically.  Suppose you get paid on the 21st of the month
  137. if it is a weekday, and to the Friday before if the 21st is on a
  138. weekend.  The diary entry
  139.  
  140.      &%%(let ((dayname (calendar-day-of-week date))
  141.               (day (car (cdr date))))
  142.            (or (and (= day 21) (memq dayname '(1 2 3 4 5)))
  143.                (and (memq day '(19 20)) (= dayname 5)))
  144.               ) Pay check deposited
  145.  
  146. to just those dates.  This example illustrates how the sexp can depend
  147. on the variable `date'; this variable is a list (MONTH DAY YEAR) that
  148. gives the Gregorian date for which the diary entries are being found.
  149. If the value of the sexp is `t', the entry applies to that date.  If
  150. the sexp evaluates to `nil', the entry does *not* apply to that date.
  151.  
  152. 
  153. File: xemacs.info,  Node: Calendar Customization,  Prev: Diary,  Up: Calendar/Diary
  154.  
  155. Customizing the Calendar and Diary
  156. ----------------------------------
  157.  
  158.    There are many customizations that you can use to make the calendar
  159. and diary suit your personal tastes.
  160.  
  161. * Menu:
  162.  
  163. * Calendar Customizing::   Defaults you can set.
  164. * Holiday Customizing::    Defining your own holidays.
  165. * Date Display Format::    Changing the format.
  166. * Time Display Format::    Changing the format.
  167. * Daylight Savings::       Changing the default.
  168. * Diary Customizing::      Defaults you can set.
  169. * Hebrew/Islamic Entries:: How to obtain them.
  170. * Fancy Diary Display::    Enhancing the diary display, sorting entries.
  171. * Included Diary Files::   Sharing a common diary file.
  172. * Sexp Diary Entries::     Fancy things you can do.
  173. * Appt Customizing::       Customizing appointment reminders.
  174.  
  175. 
  176. File: xemacs.info,  Node: Calendar Customizing,  Next: Holiday Customizing,  Up: Calendar Customization
  177.  
  178. Customizing the Calendar
  179. ........................
  180.  
  181.    If you set the variable `view-diary-entries-initially' to `t',
  182. calling up the calendar automatically displays the diary entries for
  183. the current date as well.  The diary dates appear only if the current
  184. date is visible.  If you add both of the following lines to your
  185. `.emacs' file:
  186.  
  187.      (setq view-diary-entries-initially t)
  188.      (calendar)
  189.  
  190. they display both the calendar and diary windows whenever you start
  191. Emacs.
  192.  
  193.    Similarly, if you set the variable
  194. `view-calendar-holidays-initially' to `t', entering the calendar
  195. automatically displays a list of holidays for the current three month
  196. period.  The holiday list appears in a separate window.
  197.  
  198.    You can set the variable `mark-diary-entries-in-calendar' to `t' in
  199. order to place a plus sign (`+') beside any dates with diary entries.
  200. Whenever the calendar window is displayed or redisplayed, the diary
  201. entries are automatically marked for holidays.
  202.  
  203.    Similarly, setting the variable `mark-holidays-in-calendar' to `t'
  204. places an asterisk (`*') after all holiday dates visible in the
  205. calendar window.
  206.  
  207.    There are many customizations that you can make with the hooks
  208. provided.  For example, the variable `calendar-load-hook', whose
  209. default value is `nil', is a normal hook run when the calendar package
  210. is first loaded (before actually starting to display the calendar).
  211.  
  212.    The variable `initial-calendar-window-hook', whose default value is
  213. `nil', is a normal hook run the first time the calendar window is
  214. displayed.  The function is invoked only when you first enter Calendar
  215. mode, not when you redisplay an existing Calendar window.  But if you
  216. leave the calendar with the `q' command and reenter it, the hook runs
  217. again.
  218.  
  219.    The variable `today-visible-calendar-hook', whose default value is
  220. `nil', is a normal hook run after the calendar buffer has been prepared
  221. with the calendar when the current date is visible in the window.  One
  222. use of this hook is to replace today's date with asterisks; a function
  223. `calendar-star-date' is included for this purpose.  In your `.emacs'
  224. file, put:
  225.  
  226.      (setq today-visible-calendar-hook 'calendar-star-date)
  227.  
  228. Another standard hook function adds asterisks around the current date.
  229. Here's how to use it:
  230.  
  231.      (setq today-visible-calendar-hook 'calendar-mark-today)
  232.  
  233. A corresponding variable, `today-invisible-calendar-hook', whose
  234. default value is `nil', is a normal hook run after the calendar buffer
  235. text has been prepared, if the current date is *not* visible in the
  236. window.
  237.  
  238. 
  239. File: xemacs.info,  Node: Holiday Customizing,  Next: Date Display Format,  Prev: Calendar Customizing,  Up: Calendar Customization
  240.  
  241. Customizing the Holidays
  242. ........................
  243.  
  244.    Emacs knows about holidays defined by entries on one of several
  245. lists.  You can customize theses lists of holidays to your own needs,
  246. adding holidays or deleting lists of holidays.  The lists of holidays
  247. that Emacs uses are for general holidays (`general-holidays'), local
  248. holidays (`local-holidays'), Christian holidays (`christian-holidays'),
  249. Hebrew (Jewish) holidays (`hebrew-holidays'), Islamic (Moslem) holidays
  250. (`islamic-holidays'), and other holidays (`other-holidays').
  251.  
  252.    The general holidays are, by default, holidays common throughout the
  253. United States.  To eliminate these holidays, set `general-holidays' to
  254. `nil'.
  255.  
  256.    There are no default local holidays (but sites may supply some).  You
  257. can set the variable `local-holidays' to any list of holidays, as
  258. described below.
  259.  
  260.    By default, Emacs does not consider all the holidays of these
  261. religions, only those commonly found in secular calendars.  For a more
  262. extensive collection of religious holidays, you can set any (or all) of
  263. the variables `all-christian-calendar-holidays',
  264. `all-hebrew-calendar-holidays', or `all-islamic-calendar-holidays' to
  265. `t'.  If you want to eliminate the religious holidays, set any or all
  266. of the corresponding variables `christian-holidays', `hebrew-holidays',
  267. and `islamic-holidays' to `nil'.
  268.  
  269.    You can set the variable `other-holidays' to any list of holidays.
  270. This list, normally empty, is intended for your use.
  271.  
  272.    Each of the lists (`general-holidays', `local-holidays',
  273. `christian-holidays', `hebrew-holidays', `islamic-holidays', and
  274. `other-holidays') is a list of "holiday forms", each holiday form
  275. describing a holiday (or sometimes a list of holidays).  Holiday forms
  276. may have the following formats:
  277.  
  278. `(holiday-fixed MONTH DAY STRING)'
  279.      A fixed date on the Gregorian calendar.  MONTH and DAY are
  280.      numbers, STRING is the name of the holiday.
  281.  
  282. `(holiday-float MONTH DAYNAME K STRING)'
  283.      The Kth DAYNAME in MONTH on the Gregorian calendar (DAYNAME=0 for
  284.      Sunday, and so on); negative K means count back from the end of
  285.      the month.  STRING is the name of the holiday.
  286.  
  287. `(holiday-hebrew MONTH DAY STRING)'
  288.      A fixed date on the Hebrew calendar.  MONTH and DAY are numbers,
  289.      STRING is the name of the holiday.
  290.  
  291. `(holiday-islamic MONTH DAY STRING)'
  292.      A fixed date on the Islamic calendar.  MONTH and DAY are numbers,
  293.      STRING is the name of the holiday.
  294.  
  295. `(holiday-julian MONTH DAY STRING)'
  296.      A fixed date on the Julian calendar.  MONTH and DAY are numbers,
  297.      STRING is the name of the holiday.
  298.  
  299. `(holiday-sexp SEXP STRING)'
  300.      SEXP is a Lisp expression that should use the variable `year' to
  301.      compute the date of a holiday, or `nil' if the holiday doesn't
  302.      happen this year.  The value represents the date as a list of the
  303.      form `(MONTH DAY YEAR)'.  STRING is the name of the holiday.
  304.  
  305. `(if BOOLEAN HOLIDAY-FORM &optional HOLIDAY-FORM)'
  306.      A choice between two holidays based on the value of BOOLEAN.
  307.  
  308. `(FUNCTION &optional ARGS)'
  309.      Dates requiring special computation; ARGS, if any, are passed in a
  310.      list to the function `calendar-holiday-function-FUNCTION'.
  311.  
  312.    For example, suppose you want to add Bastille Day, celebrated in
  313. France on July 14.  You can do this by adding the following line to
  314. your `.emacs' file:
  315.  
  316.      (setq other-holidays '((holiday-fixed 7 14 "Bastille Day")))
  317.  
  318. The holiday form `(holiday-fixed 7 14 "Bastille Day")' specifies the
  319. fourteenth day of the seventh month (July).
  320.  
  321.    Many holidays occur on a specific day of the week, at a specific time
  322. of month.  Here is a holiday form describing Hurricane Supplication Day,
  323. celebrated in the Virgin Islands on the fourth Monday in August:
  324.  
  325.      (holiday-float 8 1 4 "Hurricane Supplication Day")
  326.  
  327. Here the 8 specifies August, the 1 specifies Monday (Sunday is 0,
  328. Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in
  329. the month (1 specifies the first occurrence, 2 the second occurrence,
  330. -1 the last occurrence, -2 the second-to-last occurrence, and so on).
  331.  
  332.    You can specify holidays that occur on fixed days of the Hebrew,
  333. Islamic, and Julian calendars too.  For example,
  334.  
  335.      (setq other-holidays
  336.            '((holiday-hebrew 10 2 "Last day of Hanukkah")
  337.              (holiday-islamic 3 12 "Mohammed's Birthday")
  338.              (holiday-julian 4 2 "Jefferson's Birthday")))
  339.  
  340. adds the last day of Hanukkah (since the Hebrew months are numbered with
  341. 1 starting from Nisan), the Islamic feast celebrating Mohammed's
  342. birthday (since the Islamic months are numbered from 1 starting with
  343. Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the
  344. Julian calendar.
  345.  
  346.    To include a holiday conditionally, use either the `if' or the
  347. `sexp' form.  For example, American presidential elections occur on the
  348. first Tuesday after the first Monday in November of years divisible by
  349. 4:
  350.  
  351.      (holiday-sexp (if (= 0 (% year 4))
  352.                         (calendar-gregorian-from-absolute
  353.                       (1+ (calendar-dayname-on-or-before
  354.                             1 (+ 6 (calendar-absolute-from-gregorian
  355.                                      (list 11 1 year))))))
  356.                    "US Presidential Election"))
  357.  
  358. or
  359.  
  360.      (if (= 0 (% displayed-year 4))
  361.          (fixed 11
  362.                 (extract-calendar-day
  363.                   (calendar-gregorian-from-absolute
  364.                     (1+ (calendar-dayname-on-or-before
  365.                           1 (+ 6 (calendar-absolute-from-gregorian
  366.                                    (list 11 1 displayed-year)))))))
  367.                 "US Presidential Election"))
  368.  
  369.    Some holidays just don't fit into any of these forms because special
  370. calculations are involved in their determination.  In such cases you
  371. must write a Lisp function to do the calculation.  To include eclipses
  372. of the sun, for example, add `(eclipses)' to `other-holidays' and write
  373. an Emacs Lisp function `eclipses' that returns a (possibly empty) list
  374. of the relevant Gregorian dates among the range visible in the calendar
  375. window, with descriptive strings, like this:
  376.  
  377.      (((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... )
  378.  
  379. 
  380. File: xemacs.info,  Node: Date Display Format,  Next: Time Display Format,  Prev: Holiday Customizing,  Up: Calendar Customization
  381.  
  382. Date Display Format
  383. ...................
  384.  
  385.    You can customize the manner of displaying dates in the diary, in
  386. mode lines, and in messages by setting `calendar-date-display-form'.
  387. This variable is a list of expressions that can involve the variables
  388. `month', `day', and `year', all numbers in string form, and `monthname'
  389. and `dayname', both alphabetic strings.  In the American style, the
  390. default value of this list is as follows:
  391.  
  392.      ((if dayname (concat dayname ", ")) monthname " " day ", " year)
  393.  
  394. while in the European style this value is the default:
  395.  
  396.      ((if dayname (concat dayname ", ")) day " " monthname " " year)
  397.  
  398.    The ISO standard date representation is this:
  399.  
  400.      (year "-" month "-" day)
  401.  
  402. This specifies a typical American format:
  403.  
  404.      (month "/" day "/" (substring year -2))
  405.  
  406. 
  407. File: xemacs.info,  Node: Time Display Format,  Next: Daylight Savings,  Prev: Date Display Format,  Up: Calendar Customization
  408.  
  409. Time Display Format
  410. ...................
  411.  
  412.    In the calendar, diary, and related buffers, Emacs displays times of
  413. day in the conventional American style with the hours from 1 through 12,
  414. minutes, and either `am' or `pm'.  If you prefer the "military"
  415. (European) style of writing times--in which the hours go from 00 to
  416. 23--you can alter the variable `calendar-time-display-form'.  This
  417. variable is a list of expressions that can involve the variables
  418. `12-hours', `24-hours', and `minutes', all numbers in string form, and
  419. `am-pm' and `time-zone', both alphabetic strings.  The default
  420. definition of `calendar-time-display-form' is as follows:
  421.  
  422.      (12-hours ":" minutes am-pm
  423.                (if time-zone " (") time-zone (if time-zone ")"))
  424.  
  425.    Setting `calendar-time-display-form' to
  426.  
  427.      (24-hours ":" minutes
  428.                (if time-zone " (") time-zone (if time-zone ")"))
  429.  
  430. gives military-style times like `21:07 (UT)' if time zone names are
  431. defined, and times like `21:07' if they are not.
  432.  
  433. 
  434. File: xemacs.info,  Node: Daylight Savings,  Next: Diary Customizing,  Prev: Time Display Format,  Up: Calendar Customization
  435.  
  436. Daylight Savings Time
  437. .....................
  438.  
  439.    Emacs understands the difference between standard time and daylight
  440. savings time--the times given for sunrise, sunset, solstices,
  441. equinoxes, and the phases of the moon take that into account.  The rules
  442. for daylight savings time vary from place to place and have also varied
  443. historically from year to year.  To do the job properly, Emacs needs to
  444. know which rules to use.
  445.  
  446.    Some operating systems keep track of the rules that apply to the
  447. place where you are; on these systems, Emacs gets the information it
  448. needs from the system automatically.  If some or all of this
  449. information is missing, Emacs fills in the gaps with the rules
  450. currently used in Cambridge, Massachusetts.  If the default choice of
  451. rules is not appropriate for your location, you can tell Emacs the
  452. rules to use by setting certain variables.
  453.  
  454.    These variables are `calendar-daylight-savings-starts' and
  455. `calendar-daylight-savings-ends'.  Their values should be Lisp
  456. expressions that refer to the variable `year', and evaluate to the
  457. Gregorian date on which daylight savings time starts or (respectively)
  458. ends, in the form of a list `(MONTH DAY YEAR)'.  The values should be
  459. `nil' if your area does not use daylight savings time.
  460.  
  461.    Emacs uses these expressions to determine the starting date of
  462. daylight savings time for the holiday list and for correcting times of
  463. day in the solar and lunar calculations.
  464.  
  465.    The values for Cambridge, Massachusetts are as follows:
  466.  
  467.      (calendar-nth-named-day 1 0 4 year)
  468.      (calendar-nth-named-day -1 0 10 year)
  469.  
  470. i.e. the first 0th day (Sunday) of the fourth month (April) in the year
  471. specified by `year', and the last Sunday of the tenth month (October)
  472. of that year.  If daylight savings time were changed to start on
  473. October 1, you would set `calendar-daylight-savings-starts' to this:
  474.  
  475.      (list 10 1 year)
  476.  
  477.    For a more complex example, suppose daylight savings time begins on
  478. the first of Nisan on the Hebrew calendar.  You would set
  479. `calendar-daylight-savings-starts' as follows:
  480.  
  481.      (calendar-gregorian-from-absolute
  482.        (calendar-absolute-from-hebrew
  483.          (list 1 1 (+ year 3760))))
  484.  
  485. because Nisan is the first month in the Hebrew calendar and the Hebrew
  486. year differs from the Gregorian year by 3760 at Nisan.
  487.  
  488.    If there is no daylight savings time at your location, or if you want
  489. all times in standard time, set `calendar-daylight-savings-starts' and
  490. `calendar-daylight-savings-ends' to `nil'.
  491.  
  492.    This variable specifies the difference between daylight savings time
  493. and standard time, measured in minutes.  The value for Cambridge is 60.
  494.  
  495.    These variables specify is the number of minutes after midnight
  496. local time when the transition to and from daylight savings time should
  497. occur.  For Cambridge, both variables' values are 120.
  498.  
  499. 
  500. File: xemacs.info,  Node: Diary Customizing,  Next: Hebrew/Islamic Entries,  Prev: Daylight Savings,  Up: Calendar Customization
  501.  
  502. Customizing the Diary
  503. .....................
  504.  
  505.    Ordinarily, the mode line of the diary buffer window indicates any
  506. holidays that fall on the date of the diary entries.  The process of
  507. checking for holidays can take several seconds, so including holiday
  508. information delays the display of the diary buffer noticeably.  If you'd
  509. prefer to have a faster display of the diary buffer but without the
  510. holiday information, set the variable `holidays-in-diary-buffer' to
  511. `nil'.
  512.  
  513.    The variable `number-of-diary-entries' controls the number of days
  514. of diary entries to be displayed at one time.  It affects the initial
  515. display when `view-diary-entries-initially' is `t', as well as the
  516. command `M-x diary'.  For example, the default value is 1, which says
  517. to display only the current day's diary entries.  If the value is 2,
  518. both the current day's and the next day's entries are displayed.  The
  519. value can also be a vector of seven elements: if the value is `[0 2 2 2
  520. 2 4 1]' then no diary entries appear on Sunday, the current date's and
  521. the next day's diary entries appear Monday through Thursday, Friday
  522. through Monday's entries appear on Friday, while on Saturday only that
  523. day's entries appear.
  524.  
  525.    The variable `print-diary-entries-hook' is a normal hook run after
  526. preparation of a temporary buffer containing just the diary entries
  527. currently visible in the diary buffer.  (The other, irrelevant diary
  528. entries are really absent from the temporary buffer; in the diary
  529. buffer, they are merely hidden.)  The default value of this hook does
  530. the printing with the command `lpr-buffer'.  If you want to use a
  531. different command to do the printing, just change the value of this
  532. hook.  Other uses might include, for example, rearranging the lines into
  533. order by day and time.
  534.  
  535.    You can customize the form of dates in your diary file, if neither
  536. the standard American nor European styles suits your needs, by setting
  537. the variable `diary-date-forms'.  This variable is a list of forms of
  538. dates recognized in the diary file.  Each form is a list of regular
  539. expressions (*note Regexps::.) and the variables `month', `day',
  540. `year', `monthname', and `dayname'.  The variable `monthname' matches
  541. the name of the month, capitalized or not, or its three-letter
  542. abbreviation, followed by a period or not; it matches `*'.  Similarly,
  543. `dayname' matches the name of the day, capitalized or not, or its
  544. three-letter abbreviation, followed by a period or not.  The variables
  545. `month', `day', and `year' match those numerical values, preceded by
  546. arbitrarily many zeros; they also match `*'.  The default value of
  547. `diary-date-forms' in the American style is
  548.  
  549.      ((month "/" day "[^/0-9]")
  550.       (month "/" day "/" year "[^0-9]")
  551.       (monthname " *" day "[^,0-9]")
  552.       (monthname " *" day ", *" year "[^0-9]")
  553.       (dayname "\\W"))
  554.  
  555. Emacs matches of the diary entries with the date forms is done with the
  556. standard syntax table from Fundamental mode (*note Syntax Tables:
  557. (lispref)Syntax Tables.), but with the `*' changed so that it is a word
  558. constituent.
  559.  
  560.    The forms on the list must be *mutually exclusive* and must not
  561. match any portion of the diary entry itself, just the date.  If, to be
  562. mutually exclusive, the pattern must match a portion of the diary entry
  563. itself, the first element of the form *must* be `backup'.  This causes
  564. the date recognizer to back up to the beginning of the current word of
  565. the diary entry.  Even if you use `backup', the form must absolutely
  566. not match more than a portion of the first word of the diary entry.
  567. The default value of `diary-date-forms' in the European style is this
  568. list:
  569.  
  570.      ((day "/" month "[^/0-9]")
  571.       (day "/" month "/" year "[^0-9]")
  572.       (backup day " *" monthname "\\W+\\<[^*0-9]")
  573.       (day " *" monthname " *" year "[^0-9]")
  574.       (dayname "\\W"))
  575.  
  576. Notice the use of `backup' in the middle form because part of the diary
  577. entry must be matched to distinguish this form from the following one.
  578.  
  579. 
  580. File: xemacs.info,  Node: Hebrew/Islamic Entries,  Next: Fancy Diary Display,  Prev: Diary Customizing,  Up: Calendar Customization
  581.  
  582. Hebrew- and Islamic-Date Diary Entries
  583. ......................................
  584.  
  585.    Your diary file can have entries based on Hebrew or Islamic dates, as
  586. well as entries based on our usual Gregorian calendar.  However, because
  587. the processing of such entries is time-consuming and most people don't
  588. need them, you must customize the processing of your diary file to
  589. specify that you want such entries recognized.  If you want Hebrew-date
  590. diary entries, for example, you must include these lines in your
  591. `.emacs' file:
  592.  
  593.      (setq nongregorian-diary-listing-hook 'list-hebrew-diary-entries)
  594.      (setq nongregorian-diary-marking-hook 'mark-hebrew-diary-entries)
  595.  
  596. If you want Islamic-date entries, include these lines in your `.emacs'
  597. file:
  598.  
  599.      (setq nongregorian-diary-listing-hook 'list-islamic-diary-entries)
  600.      (setq nongregorian-diary-marking-hook 'mark-islamic-diary-entries)
  601.  
  602. If you want both Hebrew- and Islamic-date entries, include these lines:
  603.  
  604.      (setq nongregorian-diary-listing-hook
  605.            '(list-hebrew-diary-entries list-islamic-diary-entries))
  606.      (setq nongregorian-diary-marking-hook
  607.            '(mark-hebrew-diary-entries mark-islamic-diary-entries))
  608.  
  609.    Hebrew- and Islamic-date diary entries have the same formats as
  610. Gregorian-date diary entries, except that the date must be preceded with
  611. an `H' for Hebrew dates and an `I' for Islamic dates.  Moreover,
  612. because the Hebrew and Islamic month names are not uniquely specified
  613. by the first three letters, you may not abbreviate them.  For example,
  614. a diary entry for the Hebrew date Heshvan 25 could look like
  615.  
  616.      HHeshvan 25 Happy Hebrew birthday!
  617.  
  618. and would appear in the diary for any date that corresponds to Heshvan
  619. 25 on the Hebrew calendar.  Similarly, an Islamic-date diary entry
  620. might be
  621.  
  622.      IDhu al-Qada 25 Happy Islamic birthday!
  623.  
  624. and would appear in the diary for any date that corresponds to Dhu
  625. al-Qada 25 on the Islamic calendar.
  626.  
  627.    As with Gregorian-date diary entries, Hebrew- and Islamic-date
  628. entries are nonmarking if they are preceded with an ampersand (`&').
  629.  
  630.    There are commands to help you in making Hebrew- and Islamic-date
  631. entries to your diary:
  632.  
  633. `i h d'
  634.      Add a diary entry for the Hebrew date corresponding to the
  635.      selected date (`insert-hebrew-diary-entry').
  636.  
  637. `i h m'
  638.      Add a diary entry for the day of the Hebrew month corresponding to
  639.      the selected date (`insert-monthly-hebrew-diary-entry').
  640.  
  641. `i h y'
  642.      Add a diary entry for the day of the Hebrew year corresponding to
  643.      the selected date (`insert-yearly-hebrew-diary-entry').
  644.  
  645. `i i d'
  646.      Add a diary entry for the Islamic date corresponding to the
  647.      selected date (`insert-islamic-diary-entry').
  648.  
  649. `i i m'
  650.      Add a diary entry for the day of the Islamic month corresponding
  651.      to the selected date (`insert-monthly-islamic-diary-entry').
  652.  
  653. `i i y'
  654.      Add a diary entry for the day of the Islamic year corresponding to
  655.      the selected date (`insert-yearly-islamic-diary-entry').
  656.  
  657.    These commands work exactly like the corresponding commands for
  658. ordinary diary entries: Move point to a date in the calendar window and
  659. the above commands insert the Hebrew or Islamic date (corresponding to
  660. the date indicated by point) at the end of your diary file and you can
  661. then type the diary entry.  If you want the diary entry to be
  662. nonmarking, give a numeric argument to the command.
  663.  
  664. 
  665. File: xemacs.info,  Node: Fancy Diary Display,  Next: Included Diary Files,  Prev: Hebrew/Islamic Entries,  Up: Calendar Customization
  666.  
  667. Fancy Diary Display
  668. ...................
  669.  
  670.    Diary display works by preparing the diary buffer and then running
  671. the hook `diary-display-hook'.  The default value of this hook hides
  672. the irrelevant diary entries and then displays the buffer
  673. (`simple-diary-display').  However, if you specify the hook as follows,
  674.  
  675.      (add-hook 'diary-display-hook 'fancy-diary-display)
  676.  
  677. then fancy mode displays diary entries and holidays by copying them into
  678. a special buffer that exists only for display.  Copying provides an
  679. opportunity to change the displayed text to make it prettier--for
  680. example, to sort the entries by the dates they apply to.
  681.  
  682.    As with simple diary display, you can print a hard copy of the buffer
  683. with `print-diary-entries'.  To print a hard copy of a day-by-day diary
  684. for a week by positioning point on Sunday of that week, type `7 d' and
  685. then do `M-x print-diary-entries'.  As usual, the inclusion of the
  686. holidays slows down the display slightly; you can speed things up by
  687. setting the variable `holidays-in-diary-buffer' to `nil'.
  688.  
  689.    Ordinarily, the fancy diary buffer does not show days for which
  690. there are no diary entries, even if that day is a holiday.  If you want
  691. such days to be shown in the fancy diary buffer, set the variable
  692. `diary-list-include-blanks' to `t'.
  693.  
  694.    If you use the fancy diary display, you can use the normal hook
  695. `list-diary-entries-hook' to sort each day's diary entries by their
  696. time of day.  Add this line to your `.emacs' file:
  697.  
  698.      (add-hook 'list-diary-entries-hook 'sort-diary-entries)
  699.  
  700. For each day, this sorts diary entries that begin with a recognizable
  701. time of day according to their times.  Diary entries without times come
  702. first within each day.
  703.  
  704. 
  705. File: xemacs.info,  Node: Included Diary Files,  Next: Sexp Diary Entries,  Prev: Fancy Diary Display,  Up: Calendar Customization
  706.  
  707. Included Diary Files
  708. ....................
  709.  
  710.    If you use the fancy diary display, you can have diary entries from
  711. other files included with your own by an "include" mechanism.  This
  712. facility makes possible the sharing of common diary files among groups
  713. of users.  Lines in the diary file of this form:
  714.  
  715.      #include "FILENAME"
  716.  
  717. includes the diary entries from the file FILENAME in the fancy diary
  718. buffer (because the ordinary diary buffer is just the buffer associated
  719. with your diary file, you cannot use the include mechanism unless you
  720. use the fancy diary buffer).  The include mechanism is recursive, by
  721. the way, so that included files can include other files, and so on; you
  722. must be careful not to have a cycle of inclusions, of course.  To
  723. enable the include facility, add lines as follows to your `.emacs' file:
  724.  
  725.      (add-hook 'list-diary-entries-hook 'include-other-diary-files)
  726.      (add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
  727.  
  728. 
  729. File: xemacs.info,  Node: Sexp Diary Entries,  Next: Appt Customizing,  Prev: Included Diary Files,  Up: Calendar Customization
  730.  
  731. Sexp Entries and the Fancy Diary Display
  732. ........................................
  733.  
  734.    Sexp diary entries allow you to do more than just have complicated
  735. conditions under which a diary entry applies.  If you use the fancy
  736. diary display, sexp entries can generate the text of the entry depending
  737. on the date itself.  For example, an anniversary diary entry can insert
  738. the number of years since the anniversary date into the text of the
  739. diary entry.  Thus the `%d' in this dairy entry:
  740.  
  741.      %%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old)
  742.  
  743. gets replaced by the age, so on October 31, 1990 the entry appears in
  744. the fancy diary buffer like this:
  745.  
  746.      Arthur's birthday (42 years old)
  747.  
  748. If the diary file instead contains this entry:
  749.  
  750.      %%(diary-anniversary 10 31 1948) Arthur's %d%s birthday
  751.  
  752. the entry in the fancy diary buffer for October 31, 1990 appears like
  753. this:
  754.  
  755.      Arthur's 42nd birthday
  756.  
  757.    Similarly, cyclic diary entries can interpolate the number of
  758. repetitions that have occurred:
  759.  
  760.      %%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time)
  761.  
  762. looks like this:
  763.  
  764.      Renew medication (5th time)
  765.  
  766. in the fancy diary display on September 8, 1990.
  767.  
  768.    The generality of sexp diary entries lets you specify any diary entry
  769. that you can describe algorithmically.  Suppose you get paid on the 21st
  770. of the month if it is a weekday, and to the Friday before if the 21st is
  771. on a weekend.  The diary entry
  772.  
  773.      &%%(let ((dayname (calendar-day-of-week date))
  774.               (day (car (cdr date))))
  775.            (or (and (= day 21) (memq dayname '(1 2 3 4 5)))
  776.                (and (memq day '(19 20)) (= dayname 5)))
  777.               ) Pay check deposited
  778.  
  779. applies to just those dates.  This example illustrates how the sexp can
  780. depend on the variable `date'; this variable is a list (MONTH DAY YEAR)
  781. that gives the Gregorian date for which the diary entries are being
  782. found.  If the value of the expression is `t', the entry applies to
  783. that date.  If the expression evaluates to `nil', the entry does *not*
  784. apply to that date.
  785.  
  786.    The following sexp diary entries take advantage of the ability (in
  787. the fancy diary display) to concoct diary entries based on the date:
  788.  
  789. `%%(diary-sunrise-sunset)'
  790.      Make a diary entry for the local times of today's sunrise and
  791.      sunset.
  792.  
  793. `%%(diary-phases-of-moon)'
  794.      Make a diary entry for the phases (quarters) of the moon.
  795.  
  796. `%%(diary-day-of-year)'
  797.      Make a diary entry with today's day number in the current year and
  798.      the number of days remaining in the current year.
  799.  
  800. `%%(diary-iso-date)'
  801.      Make a diary entry with today's equivalent ISO commercial date.
  802.  
  803. `%%(diary-julian-date)'
  804.      Make a diary entry with today's equivalent date on the Julian
  805.      calendar.
  806.  
  807. `%%(diary-astro-day-number)'
  808.      Make a diary entry with today's equivalent astronomical (Julian)
  809.      day number.
  810.  
  811. `%%(diary-hebrew-date)'
  812.      Make a diary entry with today's equivalent date on the Hebrew
  813.      calendar.
  814.  
  815. `%%(diary-islamic-date)'
  816.      Make a diary entry with today's equivalent date on the Islamic
  817.      calendar.
  818.  
  819. `%%(diary-french-date)'
  820.      Make a diary entry with today's equivalent date on the French
  821.      Revolutionary calendar.
  822.  
  823. `%%(diary-mayan-date)'
  824.      Make a diary entry with today's equivalent date on the Mayan
  825.      calendar.
  826.  
  827. Thus including the diary entry
  828.  
  829.      &%%(diary-hebrew-date)
  830.  
  831. causes every day's diary display to contain the equivalent date on the
  832. Hebrew calendar, if you are using the fancy diary display.  (With simple
  833. diary display, the line `&%%(diary-hebrew-date)' appears in the diary
  834. for any date, but does nothing particularly useful.)
  835.  
  836.    There are a number of other available sexp diary entries that are
  837. important to those who follow the Hebrew calendar:
  838.  
  839. `%%(diary-rosh-hodesh)'
  840.      Make a diary entry that tells the occurrence and ritual
  841.      announcement of each new Hebrew month.
  842.  
  843. `%%(diary-parasha)'
  844.      Make a Saturday diary entry that tells the weekly synagogue
  845.      scripture reading.
  846.  
  847. `%%(diary-sabbath-candles)'
  848.      Make a Friday diary entry that tells the *local time* of Sabbath
  849.      candle lighting.
  850.  
  851. `%%(diary-omer)'
  852.      Make a diary entry that gives the omer count, when appropriate.
  853.  
  854. `%%(diary-yahrzeit MONTH DAY YEAR) NAME'
  855.      Make a diary entry marking the anniversary of a date of death.
  856.      The date is the *Gregorian* (civil) date of death.  The diary
  857.      entry appears on the proper Hebrew calendar anniversary and on the
  858.      day before.  (In the European style, the order of the parameters
  859.      is changed to DAY, MONTH, YEAR.)
  860.  
  861. 
  862. File: xemacs.info,  Node: Appt Customizing,  Prev: Sexp Diary Entries,  Up: Calendar Customization
  863.  
  864. Customizing Appointment Reminders
  865. .................................
  866.  
  867.    You can specify exactly how Emacs reminds you of an appointment and
  868. how far in advance it begins doing so.  Here are the variables that you
  869. can set:
  870.  
  871. `appt-message-warning-time'
  872.      The time in minutes before an appointment that the reminder
  873.      begins.  The default is 10 minutes.
  874.  
  875. `appt-audible'
  876.      If this is `t' (the default), Emacs rings the terminal bell for
  877.      appointment reminders.
  878.  
  879. `appt-visible'
  880.      If this is `t' (the default), Emacs displays the appointment
  881.      message in echo area.
  882.  
  883. `appt-display-mode-line'
  884.      If this is `t' (the default), Emacs displays the number of minutes
  885.      to the appointment on the mode line.
  886.  
  887. `appt-msg-window'
  888.      If this is `t' (the default), Emacs displays the appointment
  889.      message in another window.
  890.  
  891. `appt-display-duration'
  892.      The number of seconds an appointment message is displayed.  The
  893.      default is 5 seconds.
  894.  
  895. 
  896. File: xemacs.info,  Node: Sorting,  Next: Shell,  Prev: Calendar/Diary,  Up: Top
  897.  
  898. Sorting Text
  899. ============
  900.  
  901.    XEmacs provides several commands for sorting text in a buffer.  All
  902. operate on the contents of the region (the text between point and the
  903. mark).  They divide the text of the region into many "sort records",
  904. identify a "sort key" for each record, and then reorder the records
  905. using the order determined by the sort keys.  The records are ordered so
  906. that their keys are in alphabetical order, or, for numerical sorting, in
  907. numerical order.  In alphabetical sorting, all upper-case letters `A'
  908. through `Z' come before lower-case `a', in accordance with the ASCII
  909. character sequence.
  910.  
  911.    The sort commands differ in how they divide the text into sort
  912. records and in which part of each record they use as the sort key.
  913. Most of the commands make each line a separate sort record, but some
  914. commands use paragraphs or pages as sort records.  Most of the sort
  915. commands use each entire sort record as its own sort key, but some use
  916. only a portion of the record as the sort key.
  917.  
  918. `M-x sort-lines'
  919.      Divide the region into lines and sort by comparing the entire text
  920.      of a line.  A prefix argument means sort in descending order.
  921.  
  922. `M-x sort-paragraphs'
  923.      Divide the region into paragraphs and sort by comparing the entire
  924.      text of a paragraph (except for leading blank lines).  A prefix
  925.      argument means sort in descending order.
  926.  
  927. `M-x sort-pages'
  928.      Divide the region into pages and sort by comparing the entire text
  929.      of a page (except for leading blank lines).  A prefix argument
  930.      means sort in descending order.
  931.  
  932. `M-x sort-fields'
  933.      Divide the region into lines and sort by comparing the contents of
  934.      one field in each line.  Fields are defined as separated by
  935.      whitespace, so the first run of consecutive non-whitespace
  936.      characters in a line constitutes field 1, the second such run
  937.      constitutes field 2, etc.
  938.  
  939.      You specify which field to sort by with a numeric argument: 1 to
  940.      sort by field 1, etc.  A negative argument means sort in descending
  941.      order.  Thus, minus 2 means sort by field 2 in reverse-alphabetical
  942.      order.
  943.  
  944. `M-x sort-numeric-fields'
  945.      Like `M-x sort-fields', except the specified field is converted to
  946.      a number for each line and the numbers are compared.  `10' comes
  947.      before `2' when considered as text, but after it when considered
  948.      as a number.
  949.  
  950. `M-x sort-columns'
  951.      Like `M-x sort-fields', except that the text within each line used
  952.      for comparison comes from a fixed range of columns.  An explanation
  953.      is given below.
  954.  
  955.    For example, if the buffer contains:
  956.  
  957.      On systems where clash detection (locking of files being edited) is
  958.      implemented, XEmacs also checks the first time you modify a buffer
  959.      whether the file has changed on disk since it was last visited or
  960.      saved.  If it has, you are asked to confirm that you want to change
  961.      the buffer.
  962.  
  963. then if you apply `M-x sort-lines' to the entire buffer you get:
  964.  
  965.      On systems where clash detection (locking of files being edited) is
  966.      implemented, XEmacs also checks the first time you modify a buffer
  967.      saved.  If it has, you are asked to confirm that you want to change
  968.      the buffer.
  969.      whether the file has changed on disk since it was last visited or
  970.  
  971. where the upper case `O' comes before all lower case letters.  If you
  972. apply instead `C-u 2 M-x sort-fields' you get:
  973.  
  974.      saved.  If it has, you are asked to confirm that you want to change
  975.      implemented, XEmacs also checks the first time you modify a buffer
  976.      the buffer.
  977.      On systems where clash detection (locking of files being edited) is
  978.      whether the file has changed on disk since it was last visited or
  979.  
  980. where the sort keys were `If', `XEmacs', `buffer', `systems', and `the'.
  981.  
  982.    `M-x sort-columns' requires more explanation.  You specify the
  983. columns by putting point at one of the columns and the mark at the other
  984. column.  Because this means you cannot put point or the mark at the
  985. beginning of the first line to sort, this command uses an unusual
  986. definition of `region': all of the line point is in is considered part
  987. of the region, and so is all of the line the mark is in.
  988.  
  989.    For example, to sort a table by information found in columns 10 to
  990. 15, you could put the mark on column 10 in the first line of the table,
  991. and point on column 15 in the last line of the table, and then use this
  992. command.  Or you could put the mark on column 15 in the first line and
  993. point on column 10 in the last line.
  994.  
  995.    This can be thought of as sorting the rectangle specified by point
  996. and the mark, except that the text on each line to the left or right of
  997. the rectangle moves along with the text inside the rectangle.  *Note
  998. Rectangles::.
  999.  
  1000. 
  1001. File: xemacs.info,  Node: Shell,  Next: Narrowing,  Prev: Sorting,  Up: Top
  1002.  
  1003. Running Shell Commands from XEmacs
  1004. ==================================
  1005.  
  1006.    XEmacs has commands for passing single command lines to inferior
  1007. shell processes; it can also run a shell interactively with input and
  1008. output to an XEmacs buffer `*shell*'.
  1009.  
  1010. `M-!'
  1011.      Run a specified shell command line and display the output
  1012.      (`shell-command').
  1013.  
  1014. `M-|'
  1015.      Run a specified shell command line with region contents as input;
  1016.      optionally replace the region with the output
  1017.      (`shell-command-on-region').
  1018.  
  1019. `M-x shell'
  1020.      Run a subshell with input and output through an XEmacs buffer.
  1021.      You can then give commands interactively.
  1022.  
  1023. `M-x term'
  1024.      Run a subshell with input and output through an XEmacs buffer.
  1025.      You can then give commands interactively.  Full terminal emulation
  1026.      is available.
  1027.  
  1028. * Menu:
  1029.  
  1030. * Single Shell::         How to run one shell command and return.
  1031. * Interactive Shell::    Permanent shell taking input via XEmacs.
  1032. * Shell Mode::           Special XEmacs commands used with permanent shell.
  1033. * Terminal emulator::    An XEmacs window as a terminal emulator.
  1034. * Term Mode::            Special XEmacs commands used in Term mode.
  1035. * Paging in Term::       Paging in the terminal emulator.
  1036.  
  1037. 
  1038. File: xemacs.info,  Node: Single Shell,  Next: Interactive Shell,  Prev: Shell,  Up: Shell
  1039.  
  1040. Single Shell Commands
  1041. ---------------------
  1042.  
  1043.    `M-!' (`shell-command') reads a line of text using the minibuffer
  1044. and creates an inferior shell to execute the line as a command.
  1045. Standard input from the command comes from the null device.  If the
  1046. shell command produces any output, the output goes to an XEmacs buffer
  1047. named `*Shell Command Output*', which is displayed in another window
  1048. but not selected.  A numeric argument, as in `M-1 M-!', directs this
  1049. command to insert any output into the current buffer.  In that case,
  1050. point is left before the output and the mark is set after the output.
  1051.  
  1052.    `M-|' (`shell-command-on-region') is like `M-!' but passes the
  1053. contents of the region as input to the shell command, instead of no
  1054. input.  If a numeric argument is used to direct  output to the current
  1055. buffer, then the old region is deleted first and the output replaces it
  1056. as the contents of the region.
  1057.  
  1058.    Both `M-!' and `M-|' use `shell-file-name' to specify the shell to
  1059. use.  This variable is initialized based on your `SHELL' environment
  1060. variable when you start XEmacs.  If the file name does not specify a
  1061. directory, the directories in the list `exec-path' are searched; this
  1062. list is initialized based on the `PATH' environment variable when you
  1063. start XEmacs.  You can override either or both of these default
  1064. initializations in your `.emacs' file.
  1065.  
  1066.    When you use `M-!' and `M-|', XEmacs has to wait until the shell
  1067. command completes.  You can quit with `C-g'; that terminates the shell
  1068. command.
  1069.  
  1070. 
  1071. File: xemacs.info,  Node: Interactive Shell,  Next: Shell Mode,  Prev: Single Shell,  Up: Shell
  1072.  
  1073. Interactive Inferior Shell
  1074. --------------------------
  1075.  
  1076.    To run a subshell interactively with its typescript in an XEmacs
  1077. buffer, use `M-x shell'.  This creates (or reuses) a buffer named
  1078. `*shell*' and runs a subshell with input coming from and output going
  1079. to that buffer.  That is to say, any "terminal output" from the subshell
  1080. will go into the buffer, advancing point, and any "terminal input" for
  1081. the subshell comes from text in the buffer.  To give input to the
  1082. subshell, go to the end of the buffer and type the input, terminated by
  1083. RET.
  1084.  
  1085.    XEmacs does not wait for the subshell to do anything.  You can switch
  1086. windows or buffers and edit them while the shell is waiting, or while
  1087. it is running a command.  Output from the subshell waits until XEmacs
  1088. has time to process it; this happens whenever XEmacs is waiting for
  1089. keyboard input or for time to elapse.
  1090.  
  1091.    To get multiple subshells, change the name of buffer `*shell*' to
  1092. something different by using `M-x rename-buffer'.  The next use of `M-x
  1093. shell' creates a new buffer `*shell*' with its own subshell.  By
  1094. renaming this buffer as well you can create a third one, and so on.
  1095. All the subshells run independently and in parallel.
  1096.  
  1097.    The file name used to load the subshell is the value of the variable
  1098. `explicit-shell-file-name', if that is non-`nil'.  Otherwise, the
  1099. environment variable `ESHELL' is used, or the environment variable
  1100. `SHELL' if there is no `ESHELL'.  If the file name specified is
  1101. relative, the directories in the list `exec-path' are searched (*note
  1102. Single Shell Commands: Single Shell.).
  1103.  
  1104.    As soon as the subshell is started, it is sent as input the contents
  1105. of the file `~/.emacs_SHELLNAME', if that file exists, where SHELLNAME
  1106. is the name of the file that the shell was loaded from.  For example,
  1107. if you use `csh', the file sent to it is `~/.emacs_csh'.
  1108.  
  1109.    `cd', `pushd', and `popd' commands given to the inferior shell are
  1110. watched by XEmacs so it can keep the `*shell*' buffer's default
  1111. directory the same as the shell's working directory.  These commands
  1112. are recognized syntactically by examining lines of input that are sent.
  1113. If you use aliases for these commands, you can tell XEmacs to
  1114. recognize them also.  For example, if the value of the variable
  1115. `shell-pushd-regexp' matches the beginning of a shell command line,
  1116. that line is regarded as a `pushd' command.  Change this variable when
  1117. you add aliases for `pushd'.  Likewise, `shell-popd-regexp' and
  1118. `shell-cd-regexp' are used to recognize commands with the meaning of
  1119. `popd' and `cd'.
  1120.  
  1121.    `M-x shell-resync-dirs' queries the shell and resynchronizes XEmacs'
  1122. idea of what the current directory stack is.  `M-x
  1123. shell-dirtrack-toggle' turns directory tracking on and off.
  1124.  
  1125.    XEmacs keeps a history of the most recent commands you have typed in
  1126. the `*shell*' buffer.  If you are at the beginning of a shell command
  1127. line and type M-p, the previous shell input is inserted into the buffer
  1128. before point.  Immediately typing M-p again deletes that input and
  1129. inserts the one before it.  By repeating M-p you can move backward
  1130. through your commands until you find one you want to repeat.  You may
  1131. then edit the command before typing RET if you wish. M-n moves forward
  1132. through the command history, in case you moved backward past the one
  1133. you wanted while using M-p.  If you type the first few characters of a
  1134. previous command and then type M-p, the most recent shell input
  1135. starting with those characters is inserted.  This can be very
  1136. convenient when you are repeating a sequence of shell commands.  The
  1137. variable `input-ring-size' controls how many commands are saved in your
  1138. input history.  The default is 30.
  1139.  
  1140.